package com.huige.pojo;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Past;
import lombok.Data;
import lombok.NonNull;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * @Author 朱志辉
 * @Create 2024/7/20 下午6:18
 * @Version 1.0
 * Description:
 *    1.name 不为null和空字符串
 *       字符串 @NotBlank 集合 @NotEmpty 包装 @NotNull
 *    2.password 长度大于6
 *    3.age  必须大于等于1
 *    4.email 必须符合邮箱格式
 *    5.birthday 过去时间
 */
@Data
public class User {

    @NotBlank
    private String name;
    @Length(min = 6)
    private String password;
    @Min(1)
    private int age;
    @Email
    private String email;
    @Past
    private Date birthday;
}
